const defaultState = {
    token: null,
    user: {}
}
export default (state = defaultState, action) => {
    if (action.type === 'setToken') {
        let newState = JSON.parse(JSON.stringify(state))
        newState.token = action.value
        return newState
    } else if (action.type === 'setUser') {
        let newState = JSON.parse(JSON.stringify(state))
        newState.user = action.value
        return newState
    }
    return state
};